home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2005 June (DVD) / DPPRO0605DVD.iso / Install / program files / Borland / BDS / 3.0 / Demos / Delphi.Net / CLR / WindowsService / WinService.dpr < prev   
Encoding:
Text File  |  2004-10-22  |  4.9 KB  |  112 lines

  1. program WinService;
  2. //------------------------------------------------------------------------------
  3. //  File name:      WinService.dpr
  4. //  Last updated:   11/16/03
  5. //  Author:         Sergey Mishkovskiy
  6. //  Company:        USysWare, Inc.
  7. //  Contact info:   usysware@comcast.net
  8. //
  9. //  Compatibility:  Borland Delphi for .NET
  10. //
  11. //  Description:    This is a .NET Windows service skeleton. To install the
  12. //                  service use InstallUtil.exe utility, which comes with every
  13. //                  runtime version of the .NET framework. For instance, on
  14. //                  Windows XP and framework v1.1 it's located under
  15. //                  C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 folder.
  16. //                  To install the service run
  17. //                  <<Path>\InstallUtil <Path>\WinService.exe> command
  18. //                  (no brackets and with correct path). To uninstall the
  19. //                  service run <<Path>\InstallUtil /u <Path>\WinService.exe>
  20. //                  command (no brackets and with correct path).
  21. //
  22. //
  23. // Installation:    Use InstallUtil.exe utility that comes with the framework
  24. //                  to install the service. On Windows XP the installation
  25. //                  command could look like:
  26. //
  27. // "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\InstallUtil.exe" WinService.exe
  28. //
  29. //                  The installed pre-compiled service shows up as under
  30. //                  'MyDelphiWinService' name in the services list.
  31. //
  32. // Uninstallation:  Use InstallUtil.exe utility that comes with the framework
  33. //                  to uninstall the service. On Windows XP the installation
  34. //                  command could look like:
  35. //
  36. // "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\InstallUtil.exe" /u WinService.exe
  37. //------------------------------------------------------------------------------
  38.  
  39. {%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\System.dll'}
  40. {%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\System.Data.dll'}
  41. {%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\System.ServiceProcess.dll'}
  42. {%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\System.XML.dll'}
  43.  
  44. uses
  45.   System.Reflection,
  46.   System.ServiceProcess,
  47.   Service in 'Service.pas' {Service.TWindowsService: System.ServiceProcess.ServiceBase},
  48.   ProjectInstaller in 'ProjectInstaller.pas';
  49.  
  50. {$REGION 'Program/Assembly Information'}
  51. //
  52. // General Information about an assembly is controlled through the following
  53. // set of attributes. Change these attribute values to modify the information
  54. // associated with an assembly.
  55. //
  56. [assembly: AssemblyTitle('')]
  57. [assembly: AssemblyDescription('')]
  58. [assembly: AssemblyConfiguration('')]
  59. [assembly: AssemblyCompany('')]
  60. [assembly: AssemblyProduct('')]
  61. [assembly: AssemblyCopyright('')]
  62. [assembly: AssemblyTrademark('')]
  63. [assembly: AssemblyCulture('')]
  64.  
  65. //
  66. // Version information for an assembly consists of the following four values:
  67. //
  68. //      Major Version
  69. //      Minor Version 
  70. //      Build Number
  71. //      Revision
  72. //
  73. // You can specify all the values or you can default the Revision and Build Numbers 
  74. // by using the '*' as shown below:
  75.  
  76. [assembly: AssemblyVersion('1.0.*')]
  77.  
  78. //
  79. // In order to sign your assembly you must specify a key to use. Refer to the 
  80. // Microsoft .NET Framework documentation for more information on assembly signing.
  81. //
  82. // Use the attributes below to control which key is used for signing. 
  83. //
  84. // Notes: 
  85. //   (*) If no key is specified, the assembly is not signed.
  86. //   (*) KeyName refers to a key that has been installed in the Crypto Service
  87. //       Provider (CSP) on your machine. KeyFile refers to a file which contains
  88. //       a key.
  89. //   (*) If the KeyFile and the KeyName values are both specified, the 
  90. //       following processing occurs:
  91. //       (1) If the KeyName can be found in the CSP, that key is used.
  92. //       (2) If the KeyName does not exist and the KeyFile does exist, the key 
  93. //           in the KeyFile is installed into the CSP and used.
  94. //   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
  95. //       When specifying the KeyFile, the location of the KeyFile should be
  96. //       relative to the project output directory which is
  97. //       %Project Directory%\bin\<configuration>. For example, if your KeyFile is
  98. //       located in the project directory, you would specify the AssemblyKeyFile 
  99. //       attribute as [assembly: AssemblyKeyFile('..\\..\\mykey.snk')]
  100. //   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
  101. //       documentation for more information on this.
  102. //
  103. [assembly: AssemblyDelaySign(false)]
  104. [assembly: AssemblyKeyFile('')]
  105. [assembly: AssemblyKeyName('')]
  106. {$ENDREGION}
  107.  
  108. begin
  109.   WindowsService := TWindowsService.Create;
  110.   System.ServiceProcess.ServiceBase.Run(WindowsService);
  111. end.
  112.